# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=hoppy
pkgver=1.8.1
pkgrel=4
groups=('blackarch' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='A python script which tests http methods for configuration issues leaking information or just to see if they are enabled.'
arch=('any')
url='https://labs.portcullis.co.uk/downloads/'
license=('GPL2')
depends=('python2' 'python2-pyopenssl')
source=("https://labs.portcullis.co.uk/download/$pkgname-$pkgver.tar.bz2")
sha512sums=('7aa668996c2d1aa8327c4a758a0a5a6a73db5d9569950c285a414a9225996753d835522b4d58b67d545a03bf859ec10dc027df6a3705fd380e1c6561edd27ad3')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README Changelog TODO
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README Changelog TODO LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

